﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RkLibs.Configuration
{
    public interface IConfiguration
    {
        /// <summary>
        /// 配置文件全路径
        /// </summary>
         string ConfigFilePath{get;set;}
        /// <summary>
        /// 写入配置
        /// </summary>
        /// <param name="section">域</param>
        /// <param name="key">字段</param>
        /// <param name="value">值</param>
        /// <returns>true 写入成功，false写入失败</returns>
        bool WriteConfig(string section, string key, object value);
        /// <summary>
        /// 读取bool值
        /// </summary>
        /// <param name="section">域</param>
        /// <param name="key">字段</param>
        /// <param name="bDefault">默认值</param>
        /// <returns>读取的值</returns>
        bool ReadBool(string section, string key, bool bDefault);
        /// <summary>
        /// 读取整型值
        /// </summary>
        /// <param name="section">域</param>
        /// <param name="key">字段</param>
        /// <param name="nDefault">默认值</param>
        /// <returns>读取的值</returns>
        int ReadInt(string section, string key, int nDefault);
        /// <summary>
        /// 读取字符串
        /// </summary>
        /// <param name="section">域</param>
        /// <param name="key">字段</param>
        /// <param name="nDefault">默认值</param>
        /// <returns>读取的值</returns>
        string ReadString(string section, string key, string lpDefault);
        /// <summary>
        /// 删除域
        /// </summary>
        /// <param name="section">域</param>
        /// <returns>true操作成功，false操作失败</returns>
        bool DeleteSection(string section);
        /// <summary>
        /// 删除字段
        /// </summary>
        /// <param name="section">域</param>
        /// <param name="key">字段</param>
        /// <returns>true操作成功，false操作失败</returns>
        bool DeleteKey(string section, string key);
    }
}
